/* File script del sito fantacalcioleghe.altervista.org
 	Autore: Daniele Cangemi
 * */

	function createGraphic(canvas, h0, h1, h2, h3, h4, h5,lastDay){
		x = -8;
		w = 7;
		wDay = 10;
		height = 19;
		canvas = document.getElementById(canvas).getContext('2d');
		canvas.fillStyle='green'; //'rgb(162,229,162)';
		canvas.fillRect((x+=w+3), height-h5*1.5, w, h5*1.5);
		canvas.fillRect((x+=w+3), height-h4*1.5, w, h4*1.5);
		canvas.fillRect((x+=w+3), height-h3*1.5, w, h3*1.5);
		canvas.fillRect((x+=w+3), height-h2*1.5, w, h2*1.5);
		canvas.fillRect((x+=w+3), height-h1*1.5, w, h1*1.5);
		canvas.fillRect((x+=w+3), height-h0*1.5, w, h0*1.5);
		canvas.fillStyle='rgb(0,0,255)'; //disegna la riga che indica il 6
		canvas.fillRect(0, height - 6, 80, 0.5);
		//disegna i numeri delle giornate
		canvas.fillStyle = 'black';
		canvas.font = "7px Arial";
		for(i=5,j=0;i>=0;i--,j++){
			if(lastDay-1 <= 0) break;
			canvas.fillText((lastDay-i).toString(), j*wDay+7, 6);
		}
	}